<WITD application="Work item type editor" version="1.0">
    <WORKITEMTYPE name="Value Proposition">
        <DESCRIPTION>Includes information to track a business objective.</DESCRIPTION>
        <FIELDS>
            <FIELD name="WIT Category" refname="Microsoft.VSTS.Common.WITCategory" type="String" reportable="dimension">
                <!-- DO NOT CHANGE THIS FIELD OR YOU WILL BREAK CUSTOM DAEMONS AND REPORTS -->
                <HELPTEXT>Short name used to differentiate the work item type.  Daemons and reports will be based on this category instead of work item type so as to facilitate name changes on the type without breaking customizations.</HELPTEXT>
                <DEFAULT from="value" value="Value Proposition" />
                <REQUIRED/>
                <ALLOWEDVALUES expanditems="false">
                   <LISTITEM value="Value Proposition" />
                </ALLOWEDVALUES>
                <FROZEN/>
            </FIELD>


            <FIELD name="Id" refname="System.Id" type="Integer">
            </FIELD>
            <FIELD name="Title" refname="System.Title" type="String">
                <HELPTEXT>Title used to differentiate it in a list or report</HELPTEXT>
                <!-- DO NOT CHANGE RULES ON THIS FIELD OR YOU WILL BREAK CUSTOM DAEMONS AND REPORTS -->
                <REQUIRED/>
            </FIELD>
            <FIELD name="Assigned To" refname="System.AssignedTo" type="String">
                <ALLOWEDVALUES expanditems="true" filteritems="excludegroups">
                    <LISTITEM value="[Project]\Contributors" />
                    <LISTITEM value="[Project]\Project Administrators" />
                </ALLOWEDVALUES>
            </FIELD>
            <FIELD name="History" refname="System.History" type="History">
                <HELPTEXT>Discussion thread and other historical information</HELPTEXT>
            </FIELD>
            <FIELD name="Area Path" refname="System.AreaPath" type="TreePath">
                <HELPTEXT>The area of the product with which this work item is associated</HELPTEXT>
            </FIELD>
            <FIELD name="Iteration Path" refname="System.IterationPath" type="TreePath">
                <HELPTEXT>The iteration of the product with which this work item is associated</HELPTEXT>
            </FIELD>


            <FIELD name="State" refname="System.State" type="String">
                <HELPTEXT>The workflow state of the work item</HELPTEXT>
            </FIELD>
            <FIELD name="State Substate" refname="Microsoft.VSTS.Common.StateSubstate" type="String" reportable="dimension">
                <HELPTEXT>The reason why the work item is in the current state</HELPTEXT>
                <!-- Allowable values are controled in STATE and TRANSITION sections of workflow.

                     This field is used as the "real" sub-state/reason field since it is more flexible than
                     System.Reason (which can ONLY be changed when the primary state (e.g. Active, 
                     Closed etc) changes.  Of course System.Reason is required by TFS so we have
                     it in the work item types - but it isn't really utilized in any meaningful way.

                     NOTE: There are special HARDCODED assumptions about the Closed\Ignore 
                     state/sub-state combination in reports.  Ignore effectively means treat it 
                     just as if it had been deleted.  
                 -->
            </FIELD>

            <FIELD name="Reason" refname="System.Reason" type="String">
                <HELPTEXT>The reason why the work item is in the current state</HELPTEXT>
            </FIELD>
            <FIELD name="Changed Date" refname="System.ChangedDate" type="DateTime">
            </FIELD>
            <FIELD name="Changed By" refname="System.ChangedBy" type="String">
            </FIELD>
            <FIELD name="Created Date" refname="System.CreatedDate" type="DateTime">
            </FIELD>
            <FIELD name="Created By" refname="System.CreatedBy" type="String">
            </FIELD>
            <FIELD name="Description" refname="System.Description" type="PlainText">
            </FIELD>
            <!-- *************** Common Fields ****************   -->
            <FIELD name="State Change Date" refname="Microsoft.VSTS.Common.StateChangeDate" type="DateTime">
                <WHENCHANGED field="System.State">
                    <SERVERDEFAULT from="clock"/>
                </WHENCHANGED>
                <WHENNOTCHANGED field="System.State">
                    <READONLY/>
                </WHENNOTCHANGED>
            </FIELD>
            <FIELD name="Rank" refname="Microsoft.VSTS.Common.Rank" type="String" reportable="dimension">
                <HELPTEXT>Stack rank to prioritize work</HELPTEXT>
            </FIELD>
            <!-- **************** Scheduling Fields *************************************************  -->
            <FIELD name="Remaining Work" refname="Microsoft.VSTS.Scheduling.RemainingWork" type="Double" reportable="measure">
                <HELPTEXT>An estimate of the number of hours remaining to complete the work item</HELPTEXT>
            </FIELD>
            <FIELD name="Completed Work" refname="Microsoft.VSTS.Scheduling.CompletedWork" type="Double" reportable="measure">
                <HELPTEXT>The number of hours that have been completed for this work item</HELPTEXT>
            </FIELD>
        </FIELDS>
        <WORKFLOW>


            <STATES>
                <STATE value="Proposed" >
                    <FIELDS>
                        <FIELD refname="Microsoft.VSTS.Common.StateSubstate">   <EMPTY/> </FIELD>
                    </FIELDS>
                </STATE>


                <STATE value="Active">
                    <FIELDS>
                        <FIELD refname="Microsoft.VSTS.Common.StateSubstate">   <EMPTY/> </FIELD>
                    </FIELDS>
                </STATE>


                <STATE value="Closed">
                    <FIELDS>
                        <FIELD refname="Microsoft.VSTS.Common.StateSubstate">   
                            <REQUIRED/> 
                            <ALLOWEDVALUES expanditems="false">
                                <LISTITEM value="Completed" />
                                <LISTITEM value="Cut" />
                                <!--NOTE: There are special HARDCODED assumptions about the 
                                          Closed\Ignore state/sub-state combination in reports
                                          Ignore effectively means treat it just as if it had
                                          been deleted.  
                                 -->
                                <LISTITEM value="Ignore" />
                            </ALLOWEDVALUES>
                            <DEFAULT from="value" value="Completed" />
                        </FIELD>
                    </FIELDS>
                </STATE>

            </STATES>



            <TRANSITIONS>
                <TRANSITION from="" to="Active">
                    <REASONS>
                        <DEFAULTREASON value="New"/>
                    </REASONS>
                    <FIELDS>
                        <FIELD refname="System.Title">
                            <COPY from="value" value="" />
                        </FIELD>
                        <FIELD refname="System.AssignedTo">
                            <COPY from="currentuser"/>
                        </FIELD>
                    </FIELDS>
                </TRANSITION>


                <TRANSITION from="Proposed" to="Active">
                    <REASONS>
                        <DEFAULTREASON value="Activated"/>
                    </REASONS>
                </TRANSITION>

                <TRANSITION from="Proposed" to="Closed">
                    <REASONS>
                        <DEFAULTREASON value="Closed"/>
                    </REASONS>
                </TRANSITION>


                <TRANSITION from="Active" to="Proposed">
                    <REASONS>
                        <DEFAULTREASON value="Reproposed"/>
                    </REASONS>
                </TRANSITION>      
    
                <TRANSITION from="Active" to="Closed">
                    <REASONS>
                        <DEFAULTREASON value="Closed"/>
                    </REASONS>
                </TRANSITION>
        

                <TRANSITION from="Closed" to="Active">
                    <REASONS>
                        <DEFAULTREASON value="Reactivated"/>
                    </REASONS>
                </TRANSITION>

                <TRANSITION from="Closed" to="Proposed">
                    <REASONS>
                        <DEFAULTREASON value="Reproposed"/>
                    </REASONS>
                </TRANSITION>
            </TRANSITIONS>


        </WORKFLOW>



        <FORM>
            <Layout>
                <Group>
                    <Column PercentWidth="100">
                        <Control Type="FieldControl"     FieldName="System.Title"                            Label="&amp;Title:"        LabelPosition="Left"/>
                    </Column>
                </Group>
                <Group Label="Status">
                    <Column PercentWidth="100">
                        <Control Type="FieldControl"     FieldName="System.AssignedTo"                       Label="Assi&amp;gned to:"  LabelPosition="Left"/>
                        <Control Type="FieldControl"     FieldName="System.State"                            Label="&amp;State:"        LabelPosition="Left"/>            
                        <Control Type="FieldControl"     FieldName="Microsoft.VSTS.Common.StateSubstate"     Label="Substate:"          LabelPosition="Left"/> 
                    </Column>
                </Group>
                <TabGroup>

                    <Tab Label="Details">
                        <Group>
                          <Column PercentWidth="35">
                            <Control Type="WorkItemLogControl" FieldName="System.History"                         Label="History:"           LabelPosition="Top" />
                          </Column>
                          <Column FixedWidth="5">
                            <Splitter Dock="Left" />
                          </Column>
                          <Column PercentWidth="55">
                            <Control Type="HtmlFieldControl"   FieldName="System.Description"                     Label="Des&amp;cription:"  LabelPosition="Top" MinimumSize="(100,200)" />
                          </Column>
                        </Group>
                    </Tab >

                    <Tab Label="Links">
                        <Control Type="LinksControl" Name="Links_All" LabelPosition="Top" />
                    </Tab>

                    <Tab Label="File Attachments">
                        <Control Type="AttachmentsControl"/>
                    </Tab>
          
                </TabGroup>        
            </Layout>
        </FORM>
    </WORKITEMTYPE>
</WITD>
